/*
 * $Id$
 *
 * Copyright (c) 1998-2008 John Morrison.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */


/*
 * DO NOT EDIT THIS FILE - it is generated by Glade.
 */

#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <string.h>

#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>
#include "../../bolo/global.h"
#include "../linresource.h"
#include "../lang.h"
#include "gamefront.h"
#include "dialogtrackersetup.h"
#include "messagebox.h"

GtkWidget *idc_updsetuptxtthereport;
GtkWidget *idc_updsetuptxtourport;
GtkWidget *idc_updsetuptxtplayername;
GtkWidget *idc_udpmachinename;
GtkWidget *idc_updsetupremembername;
GtkWidget *us;
bool dialogUdpClosing = FALSE;

/*********************************************************
*NAME:          dialogUdpSetupDone
*AUTHOR:        John Morrison
*CREATION DATE: 20/2/99
*LAST MODIFIED: 24/2/99
*PURPOSE:
* Called on dialog finishing to pass the game options
* back to the gameFront module. Returns whether all 
* parameters are valid
*
*ARGUMENTS:
*  isJoin - True if we are joing a game else false
*********************************************************/
bool dialogUdpSetupDone(bool isJoin) {
  bool returnValue;         /* Value to return */
  gchar *str;   /* Temp string for conversions */
  char add[FILENAME_MAX];   /* Target address */
  char pn[PLAYER_NAME_LEN]; /* Player name */
  unsigned short udp;       /* Udp ports */
  unsigned short myUdp;

  returnValue = TRUE;
  str = gtk_entry_get_text(GTK_ENTRY(idc_updsetuptxtplayername));
  if (str == NULL) {
    returnValue = FALSE;
  } else {
    strncpy(pn, str, PLAYER_NAME_LEN);
  }

  utilStripName(pn);
  if (pn[0] == EMPTY_CHAR) {
    MessageBox("Sorry, you can not leave this blank", DIALOG_BOX_TITLE);
    returnValue = FALSE;
   } else if (pn[0] == '*') {
    MessageBox("Sorry, names can not begin with a '*'", DIALOG_BOX_TITLE);
    returnValue = FALSE;
  }
  str = gtk_entry_get_text(GTK_ENTRY(idc_udpmachinename));
  if (str == NULL && isJoin == TRUE) {
    returnValue = FALSE;
  } else {
    strcpy(add, str);
  }

  str = gtk_entry_get_text(GTK_ENTRY(idc_updsetuptxtthereport));
  udp = atoi(str);
  str = gtk_entry_get_text(GTK_ENTRY(idc_updsetuptxtourport));
  myUdp = atoi(str);

  if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(idc_updsetupremembername)) == TRUE) {
    gameFrontSetRemeber(TRUE);
  } else {
    gameFrontSetRemeber(FALSE);
  }

  if (returnValue == TRUE) {
    /* Send to the gamefront module */
    gameFrontSetUdpOptions(pn, add, udp, myUdp);
  }
  return returnValue;
}

gboolean dialogUdpSetupTracker(GtkWidget *widget,  GdkEventButton *event, gpointer user_data) {
  GtkWidget *tracker;

  tracker = dialogTrackerCreate();
  gtk_widget_show(tracker);
  gtk_grab_add(tracker);
  gtk_main();
  return FALSE;
}

gboolean dialogUdpSetupShow(GtkWidget *widget,  GdkEventButton *event, gpointer user_data) {
  char pn[PLAYER_NAME_LEN];   /* Player name */
  char add[PLAYER_NAME_LEN];  /* Target machine address */
  unsigned short myUdp;       /* Udp Ports */
  unsigned short targetUdp;
  char str[PLAYER_NAME_LEN];  /* Used to hold str of UDP */
  
  dialogUdpClosing = FALSE;
  gameFrontGetUdpOptions(pn, add, &targetUdp, &myUdp);
  /* Set the textboxes up */
  sprintf(str, "%i", targetUdp);
  gtk_entry_set_text(GTK_ENTRY(idc_updsetuptxtthereport), str);
  sprintf(str, "%i", myUdp); 
  gtk_entry_set_text(GTK_ENTRY(idc_updsetuptxtourport), str);
  gtk_entry_set_text(GTK_ENTRY(idc_updsetuptxtplayername), pn);
  gtk_entry_set_text(GTK_ENTRY(idc_udpmachinename), add);

  gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(idc_updsetupremembername), gameFrontGetRemeber());
}

gboolean dialogUdpSetupReJoin(GtkWidget *widget,  GdkEventButton *event, gpointer user_data) {

  if (dialogUdpSetupDone(TRUE) == TRUE) {
    gameFrontEnableRejoin();
    dialogUdpClosing = TRUE;
    gtk_widget_set_sensitive(us, FALSE);
    gdk_threads_leave();
    while(g_main_iteration(FALSE));
    gdk_threads_enter();
    dialogUdpClosing = gameFrontSetDlgState(us, openUdpJoin);
    gtk_widget_set_sensitive(us, TRUE);
  }

  
  //gameFrontSetDlgState(us, openWelcome);
  return FALSE;
}

gboolean dialogUdpSetupJoin(GtkWidget *widget,  GdkEventButton *event, gpointer user_data) {

  if (dialogUdpSetupDone(TRUE) == TRUE) {
    dialogUdpClosing = TRUE;
    gtk_widget_set_sensitive(us, FALSE);
    gdk_threads_leave();
    while(g_main_iteration(FALSE));
    gdk_threads_enter();
    dialogUdpClosing = gameFrontSetDlgState(us, openUdpJoin);
    if (dialogUdpClosing == FALSE) {
      gtk_widget_set_sensitive(us, TRUE);
    }
  }

  
  //gameFrontSetDlgState(us, openWelcome);
  return FALSE;
}


gboolean dialogUdpSetupNew(GtkWidget *widget,  GdkEventButton *event, gpointer user_data) {
  unsigned short udp;       /* Udp ports */
  unsigned short myUdp;
  gchar *str;
  str = gtk_entry_get_text(GTK_ENTRY(idc_updsetuptxtourport)); 
  myUdp = atoi(str);
  str = gtk_entry_get_text(GTK_ENTRY(idc_updsetuptxtthereport));
  udp = atoi(str);
  if (myUdp == udp) {
     MessageBox(langGetText(STR_ERR_DLGTCP_PORTS), DIALOG_BOX_TITLE);
  } else if (dialogUdpSetupDone(TRUE) == TRUE) {
    dialogUdpClosing = TRUE;
    dialogUdpClosing = gameFrontSetDlgState(us, openUdpSetup);
  } else {
    MessageBox(langGetText(STR_ERR_DLGTCP_NOTRIGHT), DIALOG_BOX_TITLE);
  }
  return FALSE;
}


gboolean dialogUdpSetupCancel(GtkWidget *widget,  GdkEventButton *event, gpointer user_data) {
  if (dialogUdpClosing == FALSE) {
    dialogUdpClosing = TRUE;
    gameFrontSetDlgState(us, openWelcome);
  }
  return FALSE;
}


GtkWidget* dialogUdpSetupCreate(void) {
  GtkWidget *dialogUdpSetup;
  GtkWidget *vbox1;
  GtkWidget *label;
  GtkWidget *hbox1;
  GtkWidget *label2;
  GtkWidget *table1;
  GtkWidget *label3;
  GtkWidget *label4;
  GtkWidget *label5;
  GtkWidget *hbox2;
  GtkWidget *label6;
  GtkWidget *hbox3;
  GtkWidget *label7;
  GtkWidget *idc_updsetuptracker;
  GtkWidget *table2;
  GtkWidget *label9;
  GtkWidget *label10;
  GtkWidget *idc_updsetupcmdcancel;
  GtkWidget *label8;
  GtkWidget *idc_updsetupcmdrejoin;
  GtkWidget *idc_updsetupcmdjoin;
  GtkWidget *idc_updsetupcmdnew;

  dialogUdpSetup = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_object_set_data (GTK_OBJECT (dialogUdpSetup), "dialogUdpSetup", dialogUdpSetup);
  gtk_container_set_border_width (GTK_CONTAINER (dialogUdpSetup), 15);
  gtk_window_set_title (GTK_WINDOW (dialogUdpSetup), "UDP (Internet) Setup");
  gtk_window_set_policy (GTK_WINDOW (dialogUdpSetup), FALSE, FALSE, FALSE);
  gtk_window_set_position (GTK_WINDOW (dialogUdpSetup), GTK_WIN_POS_CENTER);
  vbox1 = gtk_vbox_new (FALSE, 0);
  gtk_widget_ref (vbox1);
  gtk_object_set_data_full (GTK_OBJECT (dialogUdpSetup), "vbox1", vbox1,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (vbox1);
  gtk_container_add (GTK_CONTAINER (dialogUdpSetup), vbox1);

  label = gtk_label_new ("To join an internet Bolo game, you must give the name (or IP Address) of a host\nmachine running Bolo, and the UDP port number of the Bolo process on that\nmachine");
  gtk_widget_ref (label);
  gtk_object_set_data_full (GTK_OBJECT (dialogUdpSetup), "label", label,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (label);
  gtk_box_pack_start (GTK_BOX (vbox1), label, FALSE, FALSE, 0);
  gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);

  hbox1 = gtk_hbox_new (FALSE, 0);
  gtk_widget_ref (hbox1);
  gtk_object_set_data_full (GTK_OBJECT (dialogUdpSetup), "hbox1", hbox1,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (hbox1);
  gtk_box_pack_start (GTK_BOX (vbox1), hbox1, TRUE, TRUE, 6);

  label2 = gtk_label_new ("Machine Name (or IP address): ");
  gtk_widget_ref (label2);
  gtk_object_set_data_full (GTK_OBJECT (dialogUdpSetup), "label2", label2,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (label2);
  gtk_box_pack_start (GTK_BOX (hbox1), label2, FALSE, TRUE, 0);
  gtk_misc_set_alignment (GTK_MISC (label2), 0, 0.5);

  idc_udpmachinename = gtk_entry_new ();
  gtk_widget_ref (idc_udpmachinename);
  gtk_object_set_data_full (GTK_OBJECT (dialogUdpSetup), "idc_udpmachinename", idc_udpmachinename,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (idc_udpmachinename);
  gtk_box_pack_start (GTK_BOX (hbox1), idc_udpmachinename, TRUE, TRUE, 0);

  table1 = gtk_table_new (3, 2, FALSE);
  gtk_widget_ref (table1);
  gtk_object_set_data_full (GTK_OBJECT (dialogUdpSetup), "table1", table1,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (table1);
  gtk_box_pack_start (GTK_BOX (vbox1), table1, TRUE, TRUE, 0);

  idc_updsetuptxtthereport = gtk_entry_new ();
  gtk_widget_ref (idc_updsetuptxtthereport);
  gtk_object_set_data_full (GTK_OBJECT (dialogUdpSetup), "idc_updsetuptxtthereport", idc_updsetuptxtthereport,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (idc_updsetuptxtthereport);
  gtk_table_attach (GTK_TABLE (table1), idc_updsetuptxtthereport, 1, 2, 0, 1,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);

  idc_updsetuptxtourport = gtk_entry_new ();
  gtk_widget_ref (idc_updsetuptxtourport);
  gtk_object_set_data_full (GTK_OBJECT (dialogUdpSetup), "idc_updsetuptxtourport", idc_updsetuptxtourport,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (idc_updsetuptxtourport);
  gtk_table_attach (GTK_TABLE (table1), idc_updsetuptxtourport, 1, 2, 1, 2,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);

  idc_updsetuptxtplayername = gtk_entry_new ();
  gtk_widget_ref (idc_updsetuptxtplayername);
  gtk_object_set_data_full (GTK_OBJECT (dialogUdpSetup), "idc_updsetuptxtplayername", idc_updsetuptxtplayername,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (idc_updsetuptxtplayername);
  gtk_table_attach (GTK_TABLE (table1), idc_updsetuptxtplayername, 1, 2, 2, 3,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);

  label5 = gtk_label_new ("Your players name for the game: ");
  gtk_widget_ref (label5);
  gtk_object_set_data_full (GTK_OBJECT (dialogUdpSetup), "label5", label5,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (label5);
  gtk_table_attach (GTK_TABLE (table1), label5, 0, 1, 2, 3,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label5), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label5), 0.0, 0.5);

  label4 = gtk_label_new ("UDP port for the Bolo on this machine: ");
  gtk_widget_ref (label4);
  gtk_object_set_data_full (GTK_OBJECT (dialogUdpSetup), "label4", label4,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (label4);
  gtk_table_attach (GTK_TABLE (table1), label4, 0, 1, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label4), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label4), 0, 0.5);

  label3 = gtk_label_new ("UDP port of Bolo on the server machine : ");
  gtk_widget_ref (label3);
  gtk_object_set_data_full (GTK_OBJECT (dialogUdpSetup), "label3", label3,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (label3);
  gtk_table_attach (GTK_TABLE (table1), label3, 0, 1, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label3), GTK_JUSTIFY_LEFT);

  hbox2 = gtk_hbox_new (FALSE, 0);
  gtk_widget_ref (hbox2);
  gtk_object_set_data_full (GTK_OBJECT (dialogUdpSetup), "hbox2", hbox2,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (hbox2);
  gtk_box_pack_start (GTK_BOX (vbox1), hbox2, FALSE, FALSE, 8);

  label6 = gtk_label_new ("");
  gtk_widget_ref (label6);
  gtk_object_set_data_full (GTK_OBJECT (dialogUdpSetup), "label6", label6,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (label6);
  gtk_box_pack_start (GTK_BOX (hbox2), label6, TRUE, TRUE, 0);

  idc_updsetupremembername = gtk_check_button_new_with_label ("Remember player name");
  gtk_widget_ref (idc_updsetupremembername);
  gtk_object_set_data_full (GTK_OBJECT (dialogUdpSetup), "idc_updsetupremembername", idc_updsetupremembername,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (idc_updsetupremembername);
  gtk_box_pack_start (GTK_BOX (hbox2), idc_updsetupremembername, FALSE, FALSE, 0);
  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (idc_updsetupremembername), TRUE);

  hbox3 = gtk_hbox_new (FALSE, 0);
  gtk_widget_ref (hbox3);
  gtk_object_set_data_full (GTK_OBJECT (dialogUdpSetup), "hbox3", hbox3,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (hbox3);
  gtk_box_pack_start (GTK_BOX (vbox1), hbox3, TRUE, TRUE, 0);

  label7 = gtk_label_new ("");
  gtk_widget_ref (label7);
  gtk_object_set_data_full (GTK_OBJECT (dialogUdpSetup), "label7", label7,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (label7);
  gtk_box_pack_start (GTK_BOX (hbox3), label7, TRUE, TRUE, 0);

  idc_updsetuptracker = gtk_button_new_with_label ("Tracker Setup");
  gtk_widget_ref (idc_updsetuptracker);
  gtk_object_set_data_full (GTK_OBJECT (dialogUdpSetup), "idc_updsetuptracker", idc_updsetuptracker,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (idc_updsetuptracker);
  gtk_box_pack_start (GTK_BOX (hbox3), idc_updsetuptracker, FALSE, FALSE, 16);

  table2 = gtk_table_new (3, 3, FALSE);
  gtk_widget_ref (table2);
  gtk_object_set_data_full (GTK_OBJECT (dialogUdpSetup), "table2", table2,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (table2);
  gtk_box_pack_start (GTK_BOX (vbox1), table2, TRUE, TRUE, 9);

  idc_updsetupcmdcancel = gtk_button_new_with_label ("Cancel");
  gtk_widget_ref (idc_updsetupcmdcancel);
  gtk_object_set_data_full (GTK_OBJECT (dialogUdpSetup), "idc_updsetupcmdcancel", idc_updsetupcmdcancel,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (idc_updsetupcmdcancel);
  gtk_table_attach (GTK_TABLE (table2), idc_updsetupcmdcancel, 2, 3, 0, 1,
                    (GtkAttachOptions) (0),
                    (GtkAttachOptions) (0), 0, 0);

  idc_updsetupcmdrejoin = gtk_button_new_with_label ("Rejoin");
  gtk_widget_ref (idc_updsetupcmdrejoin);
  gtk_object_set_data_full (GTK_OBJECT (dialogUdpSetup), "idc_updsetupcmdrejoin", idc_updsetupcmdrejoin,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (idc_updsetupcmdrejoin);
  gtk_table_attach (GTK_TABLE (table2), idc_updsetupcmdrejoin, 1, 2, 2, 3,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (GTK_FILL), 0, 0);

  idc_updsetupcmdjoin = gtk_button_new_with_label ("Join");
  gtk_widget_ref (idc_updsetupcmdjoin);
  gtk_object_set_data_full (GTK_OBJECT (dialogUdpSetup), "idc_updsetupcmdjoin", idc_updsetupcmdjoin,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (idc_updsetupcmdjoin);
  gtk_table_attach (GTK_TABLE (table2), idc_updsetupcmdjoin, 1, 2, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (GTK_FILL), 0, 0);

  idc_updsetupcmdnew = gtk_button_new_with_label ("New");
  gtk_widget_ref (idc_updsetupcmdnew);
  gtk_object_set_data_full (GTK_OBJECT (dialogUdpSetup), "idc_updsetupcmdnew", idc_updsetupcmdnew,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (idc_updsetupcmdnew);
  gtk_table_attach (GTK_TABLE (table2), idc_updsetupcmdnew, 1, 2, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (GTK_FILL), 0, 0);

  label10 = gtk_label_new ("Click \"Rejoin\" to rejoin a game and\nreclaim your old posessions");
  gtk_widget_ref (label10);
  gtk_object_set_data_full (GTK_OBJECT (dialogUdpSetup), "label10", label10,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (label10);
  gtk_table_attach (GTK_TABLE (table2), label10, 0, 1, 2, 3,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label10), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label10), 0.0, 0.5);

  label9 = gtk_label_new ("Click to \"Join\" an existing game");
  gtk_widget_ref (label9);
  gtk_object_set_data_full (GTK_OBJECT (dialogUdpSetup), "label9", label9,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (label9);
  gtk_table_attach (GTK_TABLE (table2), label9, 0, 1, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label9), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label9), 0, 0.5);

  label8 = gtk_label_new ("Click \"New\" to begin a game                                             ");
  gtk_widget_ref (label8);
  gtk_object_set_data_full (GTK_OBJECT (dialogUdpSetup), "label8", label8,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (label8);
  gtk_table_attach (GTK_TABLE (table2), label8, 0, 1, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label8), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label8), 0, 0);

  gtk_signal_connect(GTK_OBJECT(idc_updsetupcmdcancel), "clicked", GTK_SIGNAL_FUNC(dialogUdpSetupCancel), 0);
  gtk_signal_connect(GTK_OBJECT(idc_updsetupcmdjoin), "clicked", GTK_SIGNAL_FUNC(dialogUdpSetupJoin), 0);
  gtk_signal_connect(GTK_OBJECT(idc_updsetupcmdrejoin), "clicked", GTK_SIGNAL_FUNC(dialogUdpSetupReJoin), 0);
  gtk_signal_connect(GTK_OBJECT(idc_updsetuptracker), "clicked", GTK_SIGNAL_FUNC(dialogUdpSetupTracker), 0);
  gtk_signal_connect(GTK_OBJECT(idc_updsetupcmdnew), "clicked", GTK_SIGNAL_FUNC(dialogUdpSetupNew), 0);
  gtk_signal_connect(GTK_OBJECT(dialogUdpSetup), "delete_event", GTK_SIGNAL_FUNC(dialogUdpSetupCancel), 0);
  gtk_signal_connect(GTK_OBJECT(dialogUdpSetup), "show", GTK_SIGNAL_FUNC(dialogUdpSetupShow), 0);

  us = dialogUdpSetup;

  return dialogUdpSetup;
}

